package com.ktjy.ktmall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktjy.common.annotation.Excel;
import com.ktjy.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 订单对象 t_order
 */
@Data
@TableName("t_order")
public class TOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @Excel(name = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单流水号
     */
    @Excel(name = "订单流水号")
    @TableField(value = "order_sn")
    private String orderSn;

    /**
     * 会员
     */
    @Excel(name = "会员")
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 订单状态
     */
    @Excel(name = "订单状态")
    @TableField(value = "order_state")
    private Long orderState;

    /**
     * 联系地址ID，引用于t_address地址表的主键id
     */
    @TableField(value = "address_id")
    private Long addressId;

    /**
     * 快递公司
     */
    @Excel(name = "快递公司")
    @TableField(value = "express_company")
    private String expressCompany;

    /**
     * 快递单号
     */
    @Excel(name = "快递单号")
    @TableField(value = "express_number")
    private String expressNumber;

    /**
     * 快递费用
     */
    @Excel(name = "快递费用")
    @TableField(value = "express_cost")
    private BigDecimal expressCost;

    @Excel(name = "备注")
    @TableField(value = "remark")
    private String remark;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderSn", getOrderSn())
                .append("userId", getUserId())
                .append("orderState", getOrderState())
                .append("addressId", getAddressId())
                .append("expressCompany", getExpressCompany())
                .append("expressNumber", getExpressNumber())
                .append("expressCost", getExpressCost())
                .append("remark", getRemark())
                .toString();
    }
}